<template>
  <div>
    <el-dialog width="80%" title="体检数据" v-model="visible" :close-on-click-modal="false" draggable>
      <div style="min-height: 300px;font-size: 16px !important;color:#000;" v-loading="loading">
        <div v-for="(item, index ) in detaillist" :key="index">
          <div style="font-size: 16px;font-weight: bold"> NO.{{ index + 1 }} 体检时间：{{ item.submissionTime }}</div>
          <el-row style="border: 1px rgba(0,0,0,0.2) solid;  padding: 10px;">
            <el-col :span="6"><span class="text-regular">体检编号：</span>{{ item.examNo }}</el-col>
            <el-col :span="6"><span class="text-regular">体检时间：</span>{{ item.submissionTime }}</el-col>
            <el-col :span="6"><span class="text-regular">姓名：</span>{{ item.name }}</el-col>
            <el-col :span="6"><span class="text-regular">身份证号：</span>{{ item.icCard }}</el-col>
            <el-col :span="6"><span class="text-regular">蛋白质：</span>{{ item.dbz }}</el-col>
            <el-col :span="6"><span class="text-regular">甘油三酯：</span>{{ item.gysz }}</el-col>
            <el-col :span="6"><span class="text-regular">低密度脂蛋白：</span>{{ item.dmdzdb }}</el-col>
            <el-col :span="6"><span class="text-regular">谷丙转氨酶：</span>{{ item.gbzam }}</el-col>
            <el-col :span="6"><span class="text-regular">尿素：</span>{{ item.ns }}</el-col>
            <el-col :span="6"><span class="text-regular">肌酐：</span>{{ item.jg }}</el-col>
            <el-col :span="6"><span class="text-regular">直接胆红素：</span>{{ item.zjdhs }}</el-col>
            <el-col :span="6"><span class="text-regular">尿酮体：</span>{{ item.ntt }}</el-col>
            <el-col :span="6"><span class="text-regular">糖化血红蛋白：</span>{{ item.thxhdb }}</el-col>
            <el-col :span="6"><span class="text-regular">空腹血糖：</span>{{ item.kfxd }}</el-col>
            <el-col :span="6"><span class="text-regular">尿微量白蛋白/尿肌酐：</span>{{ item.nwldbnjg }}</el-col>
            <el-col :span="6"><span class="text-regular">高密度脂蛋白：</span>{{ item.gmdzdb }}</el-col>
            <el-col :span="6"><span class="text-regular">血红蛋白：</span>{{ item.xhdb }}</el-col>
            <el-col :span="6"><span class="text-regular">间接胆红素：</span>{{ item.jjdhs }}</el-col>
            <el-col :span="6"><span class="text-regular">总胆固醇：</span>{{ item.zdgcs }}</el-col>
          </el-row>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
<script setup lang="ts" name="examView">
import {getdetaillist} from "/@/api/blood/bloodxCustomerBlood";

const detaillist = ref([])
const loading = ref(false)

const visible = ref(false)

const getData = (val: any) => {
  detaillist.value = []
  visible.value = true
  if (val.idCard || val.name) {
    loading.value = true
    getdetaillist(Object.assign({
      name: val.name,
      idCard: val.idCard,
    })).then((res) => {
      detaillist.value = res.data
      loading.value = false
    }).catch(() => {
      loading.value = false
    })
  }

}

defineExpose({
  getData
})
</script>

<style scoped lang="scss">
.text-regular {
  color: #606266;
}

.el-col {
  margin-bottom: 10px;
}
</style>
